package com.example.demo.util.converters.impl;

import com.example.demo.util.converters.MyConverter;
import com.example.demo.util.NumberUtil;
import org.springframework.stereotype.Component;

import java.lang.reflect.Field;
import java.text.ParseException;

/**
 * @author 陈浩
 * @date 2021/1/9 14:45
 */
public class ByteMyConverter implements MyConverter<Byte> {

    @Override
    public Byte convertToJavaData(String value, Field declaredField) throws ParseException {
        return NumberUtil.parseByte(value, declaredField);
    }

}
